<?php

/**
 * LogTransaction form base class.
 *
 * @method LogTransaction getObject() Returns the current form's model object
 *
 * @package    erpcrm
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseLogTransactionForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'transaction_iden'    => new sfWidgetFormInputHidden(),
      'entry_date'          => new sfWidgetFormDateTime(),
      'transaction_type'    => new sfWidgetFormInputText(),
      'transaction_subtype' => new sfWidgetFormInputText(),
      'iden1'               => new sfWidgetFormInputText(),
      'type1'               => new sfWidgetFormInputText(),
      'iden2'               => new sfWidgetFormInputText(),
      'type2'               => new sfWidgetFormInputText(),
      'iden3'               => new sfWidgetFormInputText(),
      'type3'               => new sfWidgetFormInputText(),
      'iden4'               => new sfWidgetFormInputText(),
      'type4'               => new sfWidgetFormInputText(),
      'debit'               => new sfWidgetFormInputText(),
      'credit'              => new sfWidgetFormInputText(),
      'document_iden'       => new sfWidgetFormPropelChoice(array('model' => 'Document', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'transaction_iden'    => new sfValidatorPropelChoice(array('model' => 'LogTransaction', 'column' => 'transaction_iden', 'required' => false)),
      'entry_date'          => new sfValidatorDateTime(),
      'transaction_type'    => new sfValidatorString(array('max_length' => 45)),
      'transaction_subtype' => new sfValidatorString(array('max_length' => 45)),
      'iden1'               => new sfValidatorString(array('max_length' => 20)),
      'type1'               => new sfValidatorString(array('max_length' => 45)),
      'iden2'               => new sfValidatorString(array('max_length' => 20)),
      'type2'               => new sfValidatorString(array('max_length' => 45)),
      'iden3'               => new sfValidatorString(array('max_length' => 20)),
      'type3'               => new sfValidatorString(array('max_length' => 45)),
      'iden4'               => new sfValidatorString(array('max_length' => 20)),
      'type4'               => new sfValidatorString(array('max_length' => 45)),
      'debit'               => new sfValidatorNumber(),
      'credit'              => new sfValidatorNumber(),
      'document_iden'       => new sfValidatorPropelChoice(array('model' => 'Document', 'column' => 'document_iden')),
    ));

    $this->widgetSchema->setNameFormat('log_transaction[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'LogTransaction';
  }


}
